<div>
    <h1>Login</h1>
    <?php
        echo form_open('site_controller/login');
        // start_username
        $usernameAttribute = array(
            'name' => 'username', 
            'id' => 'username',
            'value' => set_value('username')
        );
        echo "Username: " . form_input($usernameAttribute);
        // end_username
        // start_password
        $passwordAttribute = array(
            'name' => 'password', 
            'id' => 'password',
            'value' => ""
        );
        echo "<br>Password: " . form_password($passwordAttribute);
        // end_password
        echo "<br>" . form_submit('login', 'Login');
        echo form_close();
    ?>
</div>
    
<hr>
    
<div>
    <h1>Register:</h1>
    <?php
        // start_username
        echo form_open('site_controller/register');
        $usernameAttribute = array(
            'name' => 'usernameR', 
            'id' => 'usernameR',
            'value' => set_value('usernameR')
        );
        echo "Username: " . form_input($usernameAttribute);
        echo form_error('usernameR'); //this shows the error
        // end_username
        // start_email
        $emailAttribute = array(
            'name' => 'emailR', 
            'id' => 'emalR',
            'value' => set_value('emailR')
        );
        echo "<br>Email: " . form_input($emailAttribute);
        echo form_error('emailR'); //this shows the error
        // end_email
        echo "<br>" . form_submit('register', 'Register');
        echo form_close();
    ?>
    <label>A password will be e-mailed to you.</label>
</div>
<hr>